package com.shop.www.model;

import java.math.BigDecimal;

public class OrderItem {//订单详情
    private Integer orderItem_ID;
    private Integer buycount;
    private Integer commodity_ID;
    private Integer order_ID;
    private Double money;

    private Commodity commodity;


    public OrderItem(){
    }

    public OrderItem(Integer prderItem_ID) {
        this.orderItem_ID = prderItem_ID;
    }

    public OrderItem(Integer prderItem_ID, Integer buycount, Integer commodity_ID, Integer order_ID) {
        this.orderItem_ID = prderItem_ID;
        this.buycount = buycount;
        this.commodity_ID = commodity_ID;
        this.order_ID = order_ID;
    }

    public Integer getOrderItem_ID() {
        return orderItem_ID;
    }

    public void setOrderItem_ID(Integer orderItem_ID) {
        this.orderItem_ID = orderItem_ID;
    }

    public Integer getBuycount() {
        return buycount;
    }

    public void setBuycount(Integer buycount) {
        this.buycount = buycount;
    }

    public Integer getCommodity_ID() {
        return commodity_ID;
    }

    public void setCommodity_ID(Integer commodity_ID) {
        this.commodity_ID = commodity_ID;
    }

    public Integer getOrder_ID() {
        return order_ID;
    }

    public void setOrder_ID(Integer order_ID) {
        this.order_ID = order_ID;
    }

    public Double getMoney() {
        BigDecimal bigDecimalPrice = new BigDecimal(""+getCommodity().getPrice());
        BigDecimal bigDecimalBuycount = new BigDecimal(""+buycount);
        BigDecimal bigDecimalmoney = bigDecimalPrice.multiply(bigDecimalBuycount);
        money = bigDecimalmoney.doubleValue();
        return money;
    }

    public Commodity getCommodity() {
        return commodity;
    }

    public void setCommodity(Commodity commodity) {
        this.commodity = commodity;
    }
}


